//
//  UUSupplierManager.h
//  UUCharterSupplier
//
//  Created by ZhangAo on 25/01/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import <UUFoundation/DKBaseManager.h>
#import "UUSupplierRegisterInfo.h"
#import "UUSupplierPeakSeasonModel.h"

@protocol UUSupplierManagerObserver

- (void)supplierManagerDidUpdatePeakSeasons;

@end

#define GetSupplierManager()        ([UUSupplierManager sharedInstance])

@interface UUSupplierManager : DKBaseManager

// 注册供应商。当注册成功时直接登录；注册失败时返回错误信息
- (void)registerSupplierWithMobile:(NSString * _Nonnull)mobile
                            cityId:(NSString * _Nonnull)cityId
                           company:(NSString * _Nonnull)company
                           address:(NSString * _Nonnull)address
                           contact:(NSString * _Nonnull)contact
                     contactMobile:(NSString * _Nonnull)contactMobile
             transportationLicense:(NSString * _Nonnull)transportationLicense
                   businessLicense:(NSString * _Nonnull)businessLicense
                       idCardFront:(NSString * _Nonnull)idCardFront
                        idCardBack:(NSString * _Nonnull)idCardBack
                     completeBlock:(void (^ _Nonnull)(NSError * _Nullable error))completeBlock;

// 更新供应商信息
- (void)asyncUpdateSupplierRegisterInfoWithSupplierId:(id _Nonnull)supplierId
                                               cityId:(NSString * _Nonnull)cityId
                                              company:(NSString * _Nonnull)company
                                              address:(NSString * _Nonnull)address
                                              contact:(NSString * _Nonnull)contact
                                        contactMobile:(NSString * _Nonnull)contactMobile
                                transportationLicense:(NSString * _Nonnull)transportationLicense
                                      businessLicense:(NSString * _Nonnull)businessLicense
                                          idCardFront:(NSString * _Nonnull)idCardFront
                                           idCardBack:(NSString * _Nonnull)idCardBack
                                        completeBlock:(void (^ _Nonnull)(NSError * _Nullable))completeBlock;

// 获取总收入
- (void)asyncFetchTotalIncomeWithCompleteBlock:(void (^ _Nonnull)(NSNumber * _Nullable totalIncome, NSError * _Nullable error))completeBlock;

// 获取供应商完整的注册信息
- (void)asyncFetchSupplierRegisterInfoWithSupplierId:(id _Nonnull)supplierId
                                       completeBlock:(void (^ _Nonnull)(UUSupplierRegisterInfo * _Nullable, NSError * _Nullable ))completeBlock;

// 更新旺季
- (void)asyncUpdatePeakSeasons;

// 获取旺季列表
- (NSArray<id> * _Nonnull)fetchPeakSeasons;

// 根据旺季 id 取旺季 Model
- (UUSupplierPeakSeasonModel * _Nullable)fetchPeakSeasonModelWithId:(NSNumber * _Nonnull)id;

// 更新旺季，当 peakSeasonId 为 nil 添加旺季
- (void)asyncUpdatePeakSeasonWithPeakSeasonId:(NSNumber * _Nullable)peakSeasonId
                                         name:(NSString * _Nonnull)name
                                        dates:(NSArray<NSString *> * _Nonnull)dates
                                completeBlock:(void (^ _Nonnull)(NSError * _Nullable error))completeBlock;

// 删除指定的旺季
- (void)asyncDeletePeakSeasonWithId:(NSNumber * _Nonnull)id completeBlock:(void (^ _Nonnull)(NSError * _Nullable error))completeBlock;

@end
